import Deom1.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2023-11-16
 * Time: 20:48
 */
//此处向上转型是由接口在接收
public class Test {
    //向上转型的跑方法
    public static void testRun(Irun irun) {
        irun.Run();
    }
    //向上转型的游泳方法
    public static void testSwim(Iswim iswim) {
        iswim.Swim();
    }
    //向上转型飞的方法
    public static void testFly(Ifly ifly) {
        ifly.Fly();
    }
    public static void main(String[] args) {
        testRun(new Dog("旺财"));
        testRun(new Durk("唐老鸭"));
        testFly(new Bird("布谷"));
        testFly(new Durk("唐老鸭"));
        testSwim(new Fish("红鲤鱼"));
        testSwim(new Durk("唐老鸭"));
        testSwim(new Frog("小蛙"));
        testRun(new Frog("小蛙"));
        testRun(new Roboots());
    }
}
